.class Lcom/snowplowanalytics/snowplow/tracker/Tracker$1;
.super Ljava/lang/Object;

# interfaces
.implements Ljava/lang/Runnable;


# instance fields
.field final synthetic this$0:Lcom/snowplowanalytics/snowplow/tracker/Tracker;

.field final synthetic val$event:Lcom/snowplowanalytics/snowplow/tracker/events/Event;


# direct methods
.method constructor <init>(Lcom/snowplowanalytics/snowplow/tracker/Tracker;Lcom/snowplowanalytics/snowplow/tracker/events/Event;)V
    .locals 0

    iput-object p1, p0, Lcom/snowplowanalytics/snowplow/tracker/Tracker$1;->this$0:Lcom/snowplowanalytics/snowplow/tracker/Tracker;

    iput-object p2, p0, Lcom/snowplowanalytics/snowplow/tracker/Tracker$1;->val$event:Lcom/snowplowanalytics/snowplow/tracker/events/Event;

    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    return-void
.end method


# virtual methods
.method public run()V
    .locals 6

    iget-object v0, p0, Lcom/snowplowanalytics/snowplow/tracker/Tracker$1;->val$event:Lcom/snowplowanalytics/snowplow/tracker/events/Event;

    invoke-interface {v0}, Lcom/snowplowanalytics/snowplow/tracker/events/Event;->getContext()Ljava/util/List;

    move-result-object v1

    iget-object v0, p0, Lcom/snowplowanalytics/snowplow/tracker/Tracker$1;->val$event:Lcom/snowplowanalytics/snowplow/tracker/events/Event;

    invoke-interface {v0}, Lcom/snowplowanalytics/snowplow/tracker/events/Event;->getEventId()Ljava/lang/String;

    move-result-object v2

    iget-object v0, p0, Lcom/snowplowanalytics/snowplow/tracker/Tracker$1;->val$event:Lcom/snowplowanalytics/snowplow/tracker/events/Event;

    invoke-virtual {v0}, Ljava/lang/Object;->getClass()Ljava/lang/Class;

    move-result-object v0

    const-class v3, Lcom/snowplowanalytics/snowplow/tracker/events/PageView;

    invoke-virtual {v0, v3}, Ljava/lang/Object;->equals(Ljava/lang/Object;)Z

    move-result v3

    if-nez v3, :cond_0

    const-class v3, Lcom/snowplowanalytics/snowplow/tracker/events/Structured;

    invoke-virtual {v0, v3}, Ljava/lang/Object;->equals(Ljava/lang/Object;)Z

    move-result v3

    if-eqz v3, :cond_2

    :cond_0
    iget-object v3, p0, Lcom/snowplowanalytics/snowplow/tracker/Tracker$1;->this$0:Lcom/snowplowanalytics/snowplow/tracker/Tracker;

    iget-object v0, p0, Lcom/snowplowanalytics/snowplow/tracker/Tracker$1;->val$event:Lcom/snowplowanalytics/snowplow/tracker/events/Event;

    invoke-interface {v0}, Lcom/snowplowanalytics/snowplow/tracker/events/Event;->getPayload()Lcom/snowplowanalytics/snowplow/tracker/payload/Payload;

    move-result-object v0

    check-cast v0, Lcom/snowplowanalytics/snowplow/tracker/payload/TrackerPayload;

    # invokes: Lcom/snowplowanalytics/snowplow/tracker/Tracker;->addEventPayload(Lcom/snowplowanalytics/snowplow/tracker/payload/TrackerPayload;Ljava/util/List;Ljava/lang/String;)V
    invoke-static {v3, v0, v1, v2}, Lcom/snowplowanalytics/snowplow/tracker/Tracker;->access$100(Lcom/snowplowanalytics/snowplow/tracker/Tracker;Lcom/snowplowanalytics/snowplow/tracker/payload/TrackerPayload;Ljava/util/List;Ljava/lang/String;)V

    :cond_1
    :goto_0
    return-void

    :cond_2
    const-class v3, Lcom/snowplowanalytics/snowplow/tracker/events/EcommerceTransaction;

    invoke-virtual {v0, v3}, Ljava/lang/Object;->equals(Ljava/lang/Object;)Z

    move-result v3

    if-eqz v3, :cond_3

    iget-object v3, p0, Lcom/snowplowanalytics/snowplow/tracker/Tracker$1;->this$0:Lcom/snowplowanalytics/snowplow/tracker/Tracker;

    iget-object v0, p0, Lcom/snowplowanalytics/snowplow/tracker/Tracker$1;->val$event:Lcom/snowplowanalytics/snowplow/tracker/events/Event;

    invoke-interface {v0}, Lcom/snowplowanalytics/snowplow/tracker/events/Event;->getPayload()Lcom/snowplowanalytics/snowplow/tracker/payload/Payload;

    move-result-object v0

    check-cast v0, Lcom/snowplowanalytics/snowplow/tracker/payload/TrackerPayload;

    # invokes: Lcom/snowplowanalytics/snowplow/tracker/Tracker;->addEventPayload(Lcom/snowplowanalytics/snowplow/tracker/payload/TrackerPayload;Ljava/util/List;Ljava/lang/String;)V
    invoke-static {v3, v0, v1, v2}, Lcom/snowplowanalytics/snowplow/tracker/Tracker;->access$100(Lcom/snowplowanalytics/snowplow/tracker/Tracker;Lcom/snowplowanalytics/snowplow/tracker/payload/TrackerPayload;Ljava/util/List;Ljava/lang/String;)V

    iget-object v0, p0, Lcom/snowplowanalytics/snowplow/tracker/Tracker$1;->val$event:Lcom/snowplowanalytics/snowplow/tracker/events/Event;

    check-cast v0, Lcom/snowplowanalytics/snowplow/tracker/events/EcommerceTransaction;

    invoke-virtual {v0}, Lcom/snowplowanalytics/snowplow/tracker/events/EcommerceTransaction;->getItems()Ljava/util/List;

    move-result-object v1

    invoke-interface {v1}, Ljava/util/List;->iterator()Ljava/util/Iterator;

    move-result-object v2

    :goto_1
    invoke-interface {v2}, Ljava/util/Iterator;->hasNext()Z

    move-result v1

    if-eqz v1, :cond_1

    invoke-interface {v2}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v1

    check-cast v1, Lcom/snowplowanalytics/snowplow/tracker/events/EcommerceTransactionItem;

    invoke-virtual {v0}, Lcom/snowplowanalytics/snowplow/tracker/events/EcommerceTransaction;->getDeviceCreatedTimestamp()J

    move-result-wide v4

    invoke-virtual {v1, v4, v5}, Lcom/snowplowanalytics/snowplow/tracker/events/EcommerceTransactionItem;->setDeviceCreatedTimestamp(J)V

    iget-object v3, p0, Lcom/snowplowanalytics/snowplow/tracker/Tracker$1;->this$0:Lcom/snowplowanalytics/snowplow/tracker/Tracker;

    invoke-virtual {v1}, Lcom/snowplowanalytics/snowplow/tracker/events/EcommerceTransactionItem;->getPayload()Lcom/snowplowanalytics/snowplow/tracker/payload/TrackerPayload;

    move-result-object v4

    invoke-virtual {v1}, Lcom/snowplowanalytics/snowplow/tracker/events/EcommerceTransactionItem;->getContext()Ljava/util/List;

    move-result-object v5

    invoke-virtual {v1}, Lcom/snowplowanalytics/snowplow/tracker/events/EcommerceTransactionItem;->getEventId()Ljava/lang/String;

    move-result-object v1

    # invokes: Lcom/snowplowanalytics/snowplow/tracker/Tracker;->addEventPayload(Lcom/snowplowanalytics/snowplow/tracker/payload/TrackerPayload;Ljava/util/List;Ljava/lang/String;)V
    invoke-static {v3, v4, v5, v1}, Lcom/snowplowanalytics/snowplow/tracker/Tracker;->access$100(Lcom/snowplowanalytics/snowplow/tracker/Tracker;Lcom/snowplowanalytics/snowplow/tracker/payload/TrackerPayload;Ljava/util/List;Ljava/lang/String;)V

    goto :goto_1

    :cond_3
    const-class v3, Lcom/snowplowanalytics/snowplow/tracker/events/SelfDescribing;

    invoke-virtual {v0, v3}, Ljava/lang/Object;->equals(Ljava/lang/Object;)Z

    move-result v3

    if-eqz v3, :cond_4

    iget-object v0, p0, Lcom/snowplowanalytics/snowplow/tracker/Tracker$1;->val$event:Lcom/snowplowanalytics/snowplow/tracker/events/Event;

    check-cast v0, Lcom/snowplowanalytics/snowplow/tracker/events/SelfDescribing;

    iget-object v3, p0, Lcom/snowplowanalytics/snowplow/tracker/Tracker$1;->this$0:Lcom/snowplowanalytics/snowplow/tracker/Tracker;

    # getter for: Lcom/snowplowanalytics/snowplow/tracker/Tracker;->base64Encoded:Z
    invoke-static {v3}, Lcom/snowplowanalytics/snowplow/tracker/Tracker;->access$200(Lcom/snowplowanalytics/snowplow/tracker/Tracker;)Z

    move-result v3

    invoke-virtual {v0, v3}, Lcom/snowplowanalytics/snowplow/tracker/events/SelfDescribing;->setBase64Encode(Z)V

    iget-object v3, p0, Lcom/snowplowanalytics/snowplow/tracker/Tracker$1;->this$0:Lcom/snowplowanalytics/snowplow/tracker/Tracker;

    invoke-virtual {v0}, Lcom/snowplowanalytics/snowplow/tracker/events/SelfDescribing;->getPayload()Lcom/snowplowanalytics/snowplow/tracker/payload/TrackerPayload;

    move-result-object v0

    # invokes: Lcom/snowplowanalytics/snowplow/tracker/Tracker;->addEventPayload(Lcom/snowplowanalytics/snowplow/tracker/payload/TrackerPayload;Ljava/util/List;Ljava/lang/String;)V
    invoke-static {v3, v0, v1, v2}, Lcom/snowplowanalytics/snowplow/tracker/Tracker;->access$100(Lcom/snowplowanalytics/snowplow/tracker/Tracker;Lcom/snowplowanalytics/snowplow/tracker/payload/TrackerPayload;Ljava/util/List;Ljava/lang/String;)V

    goto :goto_0

    :cond_4
    const-class v3, Lcom/snowplowanalytics/snowplow/tracker/events/Timing;

    invoke-virtual {v0, v3}, Ljava/lang/Object;->equals(Ljava/lang/Object;)Z

    move-result v3

    if-nez v3, :cond_5

    const-class v3, Lcom/snowplowanalytics/snowplow/tracker/events/ScreenView;

    invoke-virtual {v0, v3}, Ljava/lang/Object;->equals(Ljava/lang/Object;)Z

    move-result v0

    if-eqz v0, :cond_1

    :cond_5
    invoke-static {}, Lcom/snowplowanalytics/snowplow/tracker/events/SelfDescribing;->builder()Lcom/snowplowanalytics/snowplow/tracker/events/SelfDescribing$Builder;

    move-result-object v3

    iget-object v0, p0, Lcom/snowplowanalytics/snowplow/tracker/Tracker$1;->val$event:Lcom/snowplowanalytics/snowplow/tracker/events/Event;

    invoke-interface {v0}, Lcom/snowplowanalytics/snowplow/tracker/events/Event;->getPayload()Lcom/snowplowanalytics/snowplow/tracker/payload/Payload;

    move-result-object v0

    check-cast v0, Lcom/snowplowanalytics/snowplow/tracker/payload/SelfDescribingJson;

    invoke-virtual {v3, v0}, Lcom/snowplowanalytics/snowplow/tracker/events/SelfDescribing$Builder;->eventData(Lcom/snowplowanalytics/snowplow/tracker/payload/SelfDescribingJson;)Lcom/snowplowanalytics/snowplow/tracker/events/SelfDescribing$Builder;

    move-result-object v0

    invoke-virtual {v0, v1}, Lcom/snowplowanalytics/snowplow/tracker/events/SelfDescribing$Builder;->customContext(Ljava/util/List;)Lcom/snowplowanalytics/snowplow/tracker/events/AbstractEvent$Builder;

    move-result-object v0

    check-cast v0, Lcom/snowplowanalytics/snowplow/tracker/events/SelfDescribing$Builder;

    iget-object v3, p0, Lcom/snowplowanalytics/snowplow/tracker/Tracker$1;->val$event:Lcom/snowplowanalytics/snowplow/tracker/events/Event;

    invoke-interface {v3}, Lcom/snowplowanalytics/snowplow/tracker/events/Event;->getDeviceCreatedTimestamp()J

    move-result-wide v4

    invoke-virtual {v0, v4, v5}, Lcom/snowplowanalytics/snowplow/tracker/events/SelfDescribing$Builder;->deviceCreatedTimestamp(J)Lcom/snowplowanalytics/snowplow/tracker/events/AbstractEvent$Builder;

    move-result-object v0

    check-cast v0, Lcom/snowplowanalytics/snowplow/tracker/events/SelfDescribing$Builder;

    iget-object v3, p0, Lcom/snowplowanalytics/snowplow/tracker/Tracker$1;->val$event:Lcom/snowplowanalytics/snowplow/tracker/events/Event;

    invoke-interface {v3}, Lcom/snowplowanalytics/snowplow/tracker/events/Event;->getEventId()Ljava/lang/String;

    move-result-object v3

    invoke-virtual {v0, v3}, Lcom/snowplowanalytics/snowplow/tracker/events/SelfDescribing$Builder;->eventId(Ljava/lang/String;)Lcom/snowplowanalytics/snowplow/tracker/events/AbstractEvent$Builder;

    move-result-object v0

    check-cast v0, Lcom/snowplowanalytics/snowplow/tracker/events/SelfDescribing$Builder;

    invoke-virtual {v0}, Lcom/snowplowanalytics/snowplow/tracker/events/SelfDescribing$Builder;->build()Lcom/snowplowanalytics/snowplow/tracker/events/SelfDescribing;

    move-result-object v0

    iget-object v3, p0, Lcom/snowplowanalytics/snowplow/tracker/Tracker$1;->this$0:Lcom/snowplowanalytics/snowplow/tracker/Tracker;

    # getter for: Lcom/snowplowanalytics/snowplow/tracker/Tracker;->base64Encoded:Z
    invoke-static {v3}, Lcom/snowplowanalytics/snowplow/tracker/Tracker;->access$200(Lcom/snowplowanalytics/snowplow/tracker/Tracker;)Z

    move-result v3

    invoke-virtual {v0, v3}, Lcom/snowplowanalytics/snowplow/tracker/events/SelfDescribing;->setBase64Encode(Z)V

    iget-object v3, p0, Lcom/snowplowanalytics/snowplow/tracker/Tracker$1;->this$0:Lcom/snowplowanalytics/snowplow/tracker/Tracker;

    invoke-virtual {v0}, Lcom/snowplowanalytics/snowplow/tracker/events/SelfDescribing;->getPayload()Lcom/snowplowanalytics/snowplow/tracker/payload/TrackerPayload;

    move-result-object v0

    # invokes: Lcom/snowplowanalytics/snowplow/tracker/Tracker;->addEventPayload(Lcom/snowplowanalytics/snowplow/tracker/payload/TrackerPayload;Ljava/util/List;Ljava/lang/String;)V
    invoke-static {v3, v0, v1, v2}, Lcom/snowplowanalytics/snowplow/tracker/Tracker;->access$100(Lcom/snowplowanalytics/snowplow/tracker/Tracker;Lcom/snowplowanalytics/snowplow/tracker/payload/TrackerPayload;Ljava/util/List;Ljava/lang/String;)V

    goto/16 :goto_0
.end method
